﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using WorkNodeFramework;
using System.Globalization;
using System.Threading;

namespace WorkNodeFrameworkDemo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            WorkNodeService service = new WorkNodeService();
            WorkNodeReader<User> users = service.GetNodes<User>("/Users", DateSetting.OpenDate(DateTime.Parse("10/12/2009 10:09:18 PM"), DateTime.Parse("10/12/2009 10:09:22 PM")));
            dataGridView1.DataSource = users.ToList();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (comboBox1.SelectedIndex == -1)
                return;
            string langID = "en-US";
            if (comboBox1.SelectedIndex == 0)
                langID = "en-US";
            else
                langID = "vi-VN";
            CultureInfo ci = CultureInfo.CreateSpecificCulture(langID);
            Thread.CurrentThread.CurrentUICulture = ci;
        }
    }
}
